Add support for multiple bundle IDs#416
Conversation
Add TEAMID_SUFFIX repository variable to allow multiple unique Bundle IDs Add xcargs to change MAIN_APP_BUNDLE_IDENTIFIER when a suffix is used. Integrate TEAMID_SUFFIX into TEAM_ID variable
OverviewThanks for looking at this again. I'm still wondering if this is the "best" approach in that Trio / iAPS has one method and LoopFollow a second and this is yet a third method. (What you've done may be decided to be the best method.). I think an alternative that adds the suffix as an optional item in the code itself (similar to LoopFollow_Second, etc.) would be preferred because you could have 2 branches in the same fork supporting different bundle IDs. The simplicity of the branch idea is then only a single fork is required to get 2 bundle IDs. I think your current method requires a separate fork (with fork environment variable) to get the different bundle ids. As someone who actually builds two apps, I'm interested in your feedback on implementation. My thoughts above are theoretical. This topic is on my list of things to review. And I appreciate you working with me on this. Change RequestIf we do decide to do this, I would want the user to be able to run without modifying their normal configuration. As part of that, I would only want a message reporting if the variable is present - not if it is not present. In other works - the annotation indicated in the validate link below would not be there. TestThe test failed so I stopped testing until this is modified to work. Configuration
Test DetailsTest that all the yml files work without need for modification by the user.
Halted the test at this point. All the yml files need to work without modification required by the user. |
541e95a to
8979be1
Compare
|
To give some background, I will be building 2 instances of Loop. One for myself (usually DEV) and one for an extended family member (always Main). @marionbarker My preference for having 2 independent forks vs 2 branches in the same fork is that it seems safer for 2 distinct Loop instances. I want to be able to work on/debug my fork, including repository-level changes, without risking any unforeseen effects on the 2nd Loop build. From my understanding:
|
|
@marionbarker Can you try your tests again? I fixed a bug tonight. |
StatusI would like to get this reviewed by some browser build "experts". I can see where this might be helpful when a breaking change is happening in addition to the use case mentioned by the author. People may want to review the new version of the app without overwriting their build on their looping phone. Seems like we should add an option to personalize the display name too. Then a user could switch between Mac-Xcode and Browser Build for the same app ID. Mac-Xcode build testThere is a standard process to configure a different bundle ID with Xcode. I used that in a manner to mock up the way this PR is configured, in other words, I used "-{suffix}" after TeamID. I used a different suffix for the Mac test than the Browser Build test so I could tell the identifiers from the two methods apart. I added "-TP" to the bundle id and name with Mac and "-TTP" using the Browser Build method. See details for the Mac change at the end of this comment. The new Identifiers that show up all start with XC as expected, with the identifiers listed below. The first one would be used to make a new app in the app store if I were going to use browser build. I was a little puzzled why the other certificates that we create with browser build do not show up. Answer is the identifiers have to be created with browser build so provisioning profiles can be added, whereas in Xcode build, the provisioning profile is updated as part of the build process on the local machine. These are the 3 new identifiers that are created on my developer site from the Xcode build.
Test this PRI did a fresh fork with a new repo name, pushed this branch to the new fork. configured the new branch as the default and set the environment variable TEAMID_SUFFIX = TTP. I tested some Actions with the new fork
There are 6 new Identifiers from the Add Identifiers Action:
I don't want to create another app that I will then hide, so I stopped here. Details for Mac Xcode modificationI made the change in the LoopWorkspace folder for the one clone where I want a unique app built. |
This change helps create multiple versions of Loop for distribution.
Steps:
Impact:
If TEAMID_SUFFIX variable does NOT exists in the repository, no change to the building steps.
If TEAMID_SUFFIX variable exists, and is formatted correctly (A-Z, 0-9, 1 to 5 characters long), the new TEAMID will have a format of: TEAMID-SUFFIX (ex. Z7P62XVNWC-ABC12)
Changes:
Add TEAMID_SUFFIX repository variable to allow multiple unique Bundle IDs
Add checks to formatting in Validate_Secrets
Pass xcargs in gym to change MAIN_APP_BUNDLE_IDENTIFIER when a suffix is used.
Append TEAMID_SUFFIX to TEAM_ID variable in fastlane and all GH actions.